package org.jeecg.modules.app.v1.applet.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.ApiLogin;
import org.jeecg.modules.app.v1.shop.entity.ApiAddShopEntity;
import org.jeecg.modules.app.v1.shop.entity.ApiListShopEntity;
import org.jeecg.modules.aspect.ApiLoginAspct;
import org.jeecg.modules.power.shop.service.IYlShopService;
import org.jeecg.modules.power.util.pack.Pack;
import org.jeecg.modules.system.entity.SysUser;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @Description: 小程序门店接口控制层
* @Author: jeecg-boot
* @Date:   2024-07-13
* @Version: V1.0
*/
@Api(tags="小程序门店接口")
@RestController
@RequestMapping("/api/v1/applet")
@Slf4j
@RequiredArgsConstructor
public class AppletShopController {

   private final IYlShopService ylShopService;

   /**
    * 分页列表查询
    * @return
    */
   @ApiOperation(value="查询门店列表（小程序）", notes="门店表")
   @GetMapping(value = "/list")
   public Result<List<ApiListShopEntity>> queryPageList(String lng,String lat,String shopName,
                                                    @RequestParam(name="number", defaultValue="20")Integer number,
                                                    @RequestParam(name="distance", defaultValue="2000")Integer distance) {
       List<ApiListShopEntity> shopIPage = ylShopService.list( lat,  lng,  shopName,distance,number);
       return Result.OK(shopIPage);
   }

}
